// ignore_for_file: avoid_print

import 'package:dio/dio.dart';
import 'package:logger/logger.dart';

// import '../api/index.dart';

class Log {
  static final logger = Logger(level: Level.debug);

  static void d(
    dynamic message, {
    DateTime? time,
    Object? error,
    StackTrace? stackTrace,
  }) {
    logger.d(message, time: time, error: error, stackTrace: stackTrace);
  }

  static void e(
    dynamic message, {
    DateTime? time,
    Object? error,
    StackTrace? stackTrace,
  }) {
    logger.e(message, time: time, error: error, stackTrace: stackTrace);
  }

  static void ee(dynamic err) {
    if (err is Error || err is DioException) {
      return e(err, stackTrace: err.stackTrace);
    }
    return e(err);
  }

  static void i(
    dynamic message, {
    DateTime? time,
    Object? error,
    StackTrace? stackTrace,
  }) {
    logger.i(message, time: time, error: error, stackTrace: stackTrace);
  }
}
